package com.demo.dao.configuration;

import com.demo.dao.enity.Student;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Scope;

@Configuration
@Lazy
//@Profile("test")
public class BeanConfiguration {

    @Bean(name = "student", initMethod = "init", destroyMethod = "destroy")
    @Scope("prototype")
    public Student student(){
        Student student = new Student();
        student.setAge(100);
        student.setName("this is a test name.");
        return student;
    }
}
